package com.gonsin.project.creator.utils;

import java.io.File;
import java.net.URI;

public class PathUtils {


    /**
     * 获取两个路径之间的相对路径
     * @param file1 长一点的路径
     * @param file2 短一点的路径
     * @return
     */
    public static String relativePath(File file1, File file2){
        URI path1 = file1.toURI();
        URI path2 = file2.toURI();
        URI relativePath = path2.relativize(path1);
        String path = relativePath.getPath();
        return path;
    }

}
